package ms07.ticketPro;

import android.app.Application;
import android.util.Log;

public class MyApplication extends Application{
	public static final String APP_NAME = "RailTicket";
	private static MyApplication instance;
	
	private Database database;
	
	public static MyApplication getInstance(){
		return instance;
	}
	
	public MyApplication(){
		super();
		
		instance = this;
	}
	
	@Override
	public void onCreate(){
		super.onCreate();
		
		this.database = new Database(this);
		Log.d(APP_NAME, "APPLICATION onCreate");
	}
	
	public void onTerminate(){
		Log.d(APP_NAME, "APPLICATION onTerminate");
		super.onTerminate();
	}
	
	public Database getDatabase(){
		return this.database;
	}
	
	public String[] getSMSProviders(){
		return this.getResources().getStringArray(R.array.sms_provider);
	}
}
